package com.biz.primus.ms.commodity.feign;

import com.biz.primus.base.vo.LocationDecodeRequestVo;
import com.biz.primus.model.geo.vo.CityItemRespVo;
import com.biz.primus.model.geo.vo.LocationAreaVo;
import com.biz.primus.model.geo.vo.ProvinceCitiesItemResponseVo;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * @author defei
 * @date 2017/9/13
 */
@FeignClient(qualifier = "geoFeignClient", name = "service-geo")
public interface GeoFeignClient {

    @GetMapping("getProvinceCities")
    List<ProvinceCitiesItemResponseVo> getProvinceCities();

    @GetMapping("getProvinceCities")
    LocationAreaVo decodeLocation(@RequestParam("cityName") String cityName,@RequestParam("districtName") String districtName);

    @GetMapping("decodeLocation")
    CityItemRespVo decodeLocation(@RequestParam("cityName") String cityName);

    @PostMapping("decodeLocation")
    CityItemRespVo decodeLocation(@RequestBody LocationDecodeRequestVo decodeRequestVo);
}
